package cn.zgliang.blog.service.impl;

import cn.zgliang.blog.dao.UserRepository;
import cn.zgliang.blog.po.User;
import cn.zgliang.blog.service.UserService;
import cn.zgliang.blog.util.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 猪哥亮
 * @email 1030681978@qq.com
 * @date 2020/3/17 16:07
 * 描述：
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository userRepository;
    @Override
    public User checkUser(String userName, String password) {
        User user = userRepository.findByUsernameAndPassword(userName, Md5Util.convert(password));
        return user;
    }
}
